<?php
/**
 * @author Thibaut Cromphaut, Gaïtano Boeraeve, Mathias Helin, Dimitry Dierickx
 * @copyright  Copyright (c) 2011 Artevelde University College Ghent 
 */

class Application_Form_AddChapter extends Zend_Form
{
    public function init()
    {
        $this->addElement('hidden', 'chapter_id', array(
            'filters'    => array('StringTrim'),
        ));
        
        $this->addElement('text', 'chapter_name', array(
            'label'      => 'Name',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('StringLength', false, array(1, 45)),
            ),
        ));
        
        $this->addElement(new Application_Form_Element_BookSelect('chapter_book_id', array(
            'label'      => 'Book',
            'required'   => true,
            'filters'    => array('StringTrim'),
        )));
        
        $this->addElement('textarea', 'chapter_description', array(
            'label'      => 'Description',
            'required'   => true,
            'filters'    => array('StringTrim'),
            'validators' => array(
                array('StringLength', false, array(1, 45)),
            ),
        ));
        
        $this->addElement('submit', 'edit', array(
            'label'      => 'Save',
        ));
        
        $this->addElement('hash', 'no_csrf_registration', array(
            'salt' => 'unique',
        ));
    }
}